# -*- coding: utf-8 -*-
import numpy as np
import pandas as pd

if __name__ == '__main__':
    series = pd.Series(range(5), index=['a', 'b', 'c', 'd', 'e'])
    print series
    print series["b":"d"]
    print series.loc["b":"d"]
    print "------------------------"
    frame = pd.DataFrame(np.random.rand(5, 4), columns=['a', 'b', 'c', 'd'])
    print frame
    print frame["a"]
    print "-----------------------"
    print frame[0:2]
    print frame.loc[0:2, "a"]
    print frame.iloc[0:2, 0]
    print frame.ix[0:2, 0]
